<template>
    <view class="content">
        <view class="bg"></view>
        <view class="wrapper">
            <view class="top" v-if="info.status == 1">
                <image src="../../static/image/us_img_04.png" class="us-img-04"></image>
                <view>待审核</view>
            </view>
            <view class="top" v-if="info.status == 2">
                <image src="../../static/image/us_img_05.png" class="us-img-05"></image>
                <view>培训中</view>
            </view>
            <view class="fail" v-if="info.status == 3">
                <view class="fail-top">
                    <image src="../../static/image/us_img_06.png" class="us-img-06"></image>
                    <view>审核失败</view>
                </view>
                <view class="tip-box">
                    <view class="tip-tit">
                        <image :src="IMAGEURL + 'static/icon/tip.png'" class="tip-icon"></image>
                        <view>审核失败原因说明</view>
                    </view>
                    <view class="tip-text">
                        <u-parse :html="info.reason"></u-parse>
                    </view>
                </view>
            </view>
            <!-- status 0未申请 1待审核 2培训中 3驳回 4通过 -->
            <view class="box">
                <view class="item">
                    <view class="grey">头像</view>
                    <view class="img-box">
                        <image :src="info.service_img" v-if="info.service_img" class="avatar"></image>
                        <image :src="IMAGEURL +  '/static/icon/avatar.png'" v-if="!info.service_img" class="avatar"></image>
                    </view>
                </view>
                <view class="item">
                    <view class="grey">手机号</view>
                    <view class="item-right">
                        <input type="number" v-model="info.mobile" placeholder="请输入手机号" class="inp" disabled>
                    </view>
                </view>
                <view class="item">
                    <view class="grey">婚姻状况</view>
                    <view class="item-right">
                        <input type="text" v-model="info.marriage" placeholder="请选择" class="inp" disabled>
                        <!-- <u-icon name="arrow-down-fill" color="#535353" size="24" class="u-m-l-10"></u-icon> -->
                    </view>
                </view>
                <view class="item">
                    <view class="grey">学历</view>
                    <view class="item-right">
                        <input type="text" v-model="info.education" placeholder="请选择" class="inp" disabled>
                        <!-- <u-icon name="arrow-down-fill" color="#535353" size="24" class="u-m-l-10"></u-icon> -->
                    </view>
                </view>
                <view class="item">
                    <view class="grey">家庭人口数</view>
                    <view class="item-right">
                        <input type="number" v-model="info.people_num" placeholder="请输入家庭人口数" class="inp" disabled>
                    </view>
                </view>
                <view class="item">
                    <view class="grey">宗教信仰</view>
                    <view class="item-right">
                        <input type="text" v-model="info.belief" placeholder="请选择" class="inp" disabled>
                        <!-- <u-icon name="arrow-down-fill" color="#535353" size="24" class="u-m-l-10"></u-icon> -->
                    </view>
                </view>
                <view class="item">
                    <view class="grey">政治面貌</view>
                    <view class="item-right">
                        <input type="text" v-model="info.politics" placeholder="请选择" class="inp" disabled>
                        <!-- <u-icon name="arrow-down-fill" color="#535353" size="24" class="u-m-l-10"></u-icon> -->
                    </view>
                </view>
            </view>
            
            <view class="btn" v-if="info.status == 3" @click="$cTo(`/mine/pages/apply/apply`)">编辑资料</view>
        </view>
    </view>
</template>

<script>
    import { IMAGEURL } from '@/static/js/common.js';
    export default {
        data() {
            return {
                IMAGEURL,
                info: {},
            };
        },
        onLoad() {
            this.getInfo()
        },
        methods: {
            getInfo() {
            	this.$ajax('user_detail', {
            		user_token: this.$getSync('userToken'),
            	}).then(ret => {
            		if (ret.success == 1000) {
                        this.info = ret.detail
            		} else {
            			this.$toast(ret.msg);
            		}
            	});
            },
        }
    };
</script>

<style lang="scss">
    
    page{
        background-color: #f5f5f5;
    }
    .bg {
    	width: 100%;
    	height: 390rpx;
    	position: absolute;
    	top: 0;
    	left: 0;
    	z-index: -1;
    	background: linear-gradient(to bottom, #f29700, #f5f5f5);
    }
    .wrapper{
        padding: 20rpx;
    }
    .fail{
        background-color: #fff;
        border-radius: 15rpx;
        margin-bottom: 20rpx;
        padding: 35rpx;
    }
    .fail-top{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        font-size: 32rpx;
        padding-bottom: 35rpx;
    }
    .tip-box{
        padding-top: 35rpx;
        border-top: 2rpx solid #eee;
    }
    .tip-tit{
        display: flex;
        justify-content: flex-start;
        align-items: center;
        font-size: 28rpx;
    }
    .tip-icon{
        width: 26rpx;
        height: 26rpx;
        margin-right: 15rpx;
    }
    .tip-text{
        font-size: 24rpx;
        color: #acacac;
        padding-top: 15rpx;
    }
    
    
    
    .top{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        font-size: 32rpx;
        padding: 35rpx;
        background-color: #fff;
        border-radius: 15rpx;
        margin-bottom: 20rpx;
    }
    .us-img-04{
        width: 210rpx;
        height: 216rpx;
        margin-bottom: 15rpx;
    }
    .us-img-05{
        width: 183rpx;
        height: 222rpx;
        margin-bottom: 15rpx;
    }
    .us-img-06{
        width: 199rpx;
        height: 214rpx;
        margin-bottom: 15rpx;
    }
    .box{
        padding: 0 20rpx;
        background-color: #fff;
        border-radius: 15rpx;
        margin-bottom: 30rpx;
    }
    .item{
        padding: 35rpx 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2rpx solid #eee;
    }
    .item:last-child{
        border-bottom: none;
    }
    .grey{
        color: #000;
    }
    .img-box{
        position: relative;
    }
    .avatar{
        width: 120rpx;
        height: 120rpx;
        border-radius: 50%;
    }
    .up{
        width: 100rpx;
        height: 33rpx;
        background-color: #f6f6f6;
        border-radius: 6rpx;
        font-size: 22rpx;
        color: #9a9a9a;
        text-align: center;
        line-height: 33rpx;
        position: absolute;
        bottom: -10rpx;
        left: 50%;
        transform: translateX(-50%);
    }
    .item-right{
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding-left: 15rpx;
    }
    .inp{
        flex: 1;
        text-align: right;
    }
    
    .btn{
        font-size: 34rpx;
        color: #fff;
        text-align: center;
        padding: 25rpx;
        background-color: #f29700;
        border-radius: 10rpx;
        margin: 50rpx 0;
    }

</style>
